<?php

namespace App\Lib;

use App\Constants\ErrorCode;
use Exception;
use Hyperf\Server\Exception\ServerException;
use Throwable;

class ValidateException extends Exception
{

    public function __construct(int $code = 1501, string $message = null)
    {
        parent::__construct($message, $code, null);

        if (is_null($message)) {
            $message = ErrorCode::getMessage($code);
        }
    }
}